#include"UdpServer.hpp"
#include"Logger.hpp"
#include<iostream>
#include<memory>

void Usage(std::string proc)
{
    std::cerr << "Usage: " <<proc << " localport" << std::endl;
}

// ./udp_server serverpost
int main(int argc , char* argv[])
{
    if(argc != 2)
    {
        Usage(argv[0]);
        exit(0);
    }

    //获取端口
    uint16_t port = std::stoi(argv[1]);

    EnableConsoleLogStrategy();//将日志信息打印到显示屏上
    std::unique_ptr<UdpServer> usvr = std::make_unique<UdpServer>(port);
    usvr->Init();
    usvr->Start();

    return 0;
}